home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / euro_net.c < prev    next >
C/C++ Source or Header  |  1996-03-19  |  2KB  |  67 lines

  1. #include <stdio.h>
  2.  
  3. #include "c:\netnow\hmistd.h"
  4. #include "c:\netnow\netnow.h"
  5. #include "c:\netnow\vdata.h"
  6. #include "c:\netnow\vchat.h"
  7. #include "cgdv.h"
  8. #include "c:\sos\include\sosm.h"
  9.  
  10. #define    MAX_USERS    20
  11. #define    No                  0
  12. #define    Yes              1
  13.  
  14. extern    int    network_on;
  15. extern    volatile int NetTeams[MAX_USERS],Players[MAX_USERS];
  16.  
  17.     char    EUROnetInitialise     =    No;
  18.  
  19. //********************************************************************************************************************************
  20.  
  21. void    InitEUROnet()
  22.     {
  23.  
  24.         if ( ( hmiNETNOWInitSystem(20)!=_NETNOW_NO_ERROR) )
  25.         {
  26.             EUROnetInitialise    = No;
  27.             printf    ("˛ Network cannot be initialised.\n");
  28.             fflush(stdout);
  29.         }
  30.  
  31.         else
  32.  
  33.         {
  34.             EUROnetInitialise    = Yes;
  35.             printf    ("˛ Network initialised okay.\n");
  36.             fflush(stdout);
  37.         }
  38.  
  39.     }
  40.     
  41. //********************************************************************************************************************************
  42.  
  43. void    UnInitEUROnet()
  44.     {
  45.         if ( EUROnetInitialise == Yes )
  46.             hmiNETNOWUnInitSystem();
  47.         EUROnetInitialise    = No;
  48.     }
  49.     
  50. //********************************************************************************************************************************
  51.  
  52. char    CountNumberOfNETstarts()
  53.     {
  54.         char    Starts    =    0;
  55.         char    i;
  56.  
  57.          for ( i=0; i < network_on; i++ )
  58.              {
  59.                  if (NetTeams[i] >= 2)
  60.                       Starts++;
  61.              } 
  62.         return( network_on-Starts );
  63.     }
  64.  
  65. //********************************************************************************************************************************
  66.  
  67.